<?php
/**
 * Created by 柚子i.
 * User: Emperor
 * Date: 2019/7/19
 * Time: 11:40
 */

namespace app\api\controller;

use app\common\service\control\ControlPlanTrack;

class ControlPlan extends BaseController
{
    /**
     * Notes :获取无效预案列表
     * @param ControlPlanTrack $control
     * @author lichao   2019/8/15
     */
    public function getInvalidPlanList(ControlPlanTrack $control)
    {
        $data = array();
        try {
            $param = $this->request->param();

            $data = $control->getInvalidPlan($param);
        } catch (\Exception $e) {
            $this->error($e->getMessage());
        }
        $this->success('获取无效预案列表成功', $data);
    }

    /**
     * Notes :获取跟踪预案列表
     * @param ControlPlanTrack $control
     * @author lichao   2019/7/19
     */
    public function getTrackPlanList(ControlPlanTrack $control)
    {
        $data = array();
        try {
            $param = $this->request->param();

            $data = $control->getTrackPlan($param);
        } catch (\Exception $e) {
            $this->error($e->getMessage());
        }
        $this->success('获取跟踪预案列表成功', $data);
    }

    /**
     * Notes :获取待评估预案列表
     * @param ControlPlanTrack $control
     * @author lichao   2019/7/19
     */
    public function getAssessPlanList(ControlPlanTrack $control)
    {
        $data = array();
        try {
            $param = $this->request->param();

            $data = $control->getAssessPlan($param);
        } catch (\Exception $e) {
            $this->error($e->getMessage());
        }
        $this->success('获取待评估预案列表成功', $data);
    }

    /**
     * Notes :获取完成预案列表
     * @param ControlPlanTrack $control
     * @author lichao   2019/7/19
     */
    public function getFinishPlanList(ControlPlanTrack $control)
    {
        $data = array();
        try {
            $param = $this->request->param();

            $data = $control->getFinishPlan($param);
        } catch (\Exception $e) {
            $this->error($e->getMessage());
        }
        $this->success('获取完成预案列表成功', $data);
    }
}
